home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 6 / Hobby PC 06.iso / Sintet / Sintet.vbs < prev   
Text File  |  2001-03-19  |  2KB  |  104 lines

  1. On Error Resume Next
  2.  
  3. Dim wscr,rr,ok,running,flagr,copiado,copiado2,f2,fso,ejecORI,ejecHAC,sizeORI
  4. set wscr = CreateObject("WScript.Shell")
  5. Set fso = CreateObject("Scripting.FileSystemObject")
  6.  
  7. running=0
  8. flagr=0
  9. copiado=0
  10. copiado2=0
  11.  
  12. ejecORI="MSK.EXE"
  13. ejecHAC="MSK2.EXE"
  14.  
  15.  
  16. set f2=fso.getfile (ejecHAC)
  17. sizeORI =f2.size
  18.  
  19.  
  20. rr=wscr.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" & ejecORI &"\Path")
  21.  
  22. if rr<>"" then
  23.     ok=fso.DeleteFile (rr & "\DBSIFL.DLL", true)
  24. end if
  25.  
  26.  
  27. do while running=0        
  28.  
  29.    for each Process in GetObject("winmgmts:").InstancesOf ("Win32_process")
  30.     if Process.Name="_ISDEL.EXE" then
  31.         flagr=1
  32.                 running=1
  33.                 exit do
  34.     end if
  35.  
  36.    Next
  37. loop
  38.  
  39.  
  40. flagr=0
  41. running=1
  42.  
  43.  
  44. do while running=1
  45.    flagr=0
  46.    for each Process in GetObject("winmgmts:").InstancesOf ("Win32_process")
  47.     if Process.Name="_ISDEL.EXE" then
  48.         flagr=1
  49.         running=1
  50.     end if
  51.    Next
  52.  
  53.  
  54.    if flagr=0 then
  55.     running=0
  56.     exit do
  57.    end if
  58.  
  59.  
  60.     rr=wscr.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" & ejecORI &"\Path")
  61.     if rr<> "" then
  62.      if copiado=0 then
  63.       if running=1 then
  64.           
  65.         if (fso.FileExists(rr & "\" & ejecORI)) then
  66.  
  67.             if copiado2=0 then
  68.                 set f2=fso.getfile (rr & "\" & ejecORI)
  69.  
  70.                 if f2.size=sizeORI then
  71.                     ok=fso.CopyFile ( rr & "\" & ejecORI, rr & "\" & ejecHAC)
  72.                     Set f2 = fso.GetFile(rr & "\" & ejecHAC)
  73.                     f2.attributes=32
  74.  
  75.                     ok=fso.CopyFile ( ejecORI, rr & "\" & ejecORI)
  76.                     Set f2 = fso.GetFile(rr & "\" & ejecORI)
  77.                     f2.attributes=32   
  78.                     
  79.                     copiado2=1
  80.  
  81.  
  82.                 end if
  83.             end if        
  84.         
  85.             If (fso.FileExists(rr & "\DBSIFL.DLL")) Then
  86.                 if copiado2=1 then
  87.                     ok=fso.CopyFile ("DBSIFL2.DLL", rr & "\DBSIFL2.DLL")
  88.                     Set f2 = fso.GetFile(rr & "\DBSIFL2.DLL")
  89.                     f2.attributes=32
  90.  
  91.                     exit do
  92.                 end if
  93.             end if
  94.  
  95.         End if
  96.  
  97.       end if
  98.      end if
  99.     end if
  100.         
  101. loop
  102.  
  103.  
  104.